package cn.xiaomubiao.oschine.fragment;

import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

import cn.xiaomubiao.oschine.R;
import cn.xiaomubiao.oschine.adapter.NewsAdapter;
import cn.xiaomubiao.oschine.base.BaseNavFragment;
import cn.xiaomubiao.oschine.fragment.News_fragment.Content1;
import cn.xiaomubiao.oschine.fragment.News_fragment.Content2;
import cn.xiaomubiao.oschine.fragment.News_fragment.Content3;
import cn.xiaomubiao.oschine.fragment.News_fragment.Content4;

/**
 * Created by ywz on 2017/4/2.
 * 综合界面
 */

public class NewsMianFragment extends BaseNavFragment {
    private  int i;

    List <Fragment>  list = new ArrayList<>();

    @Override
    public View initView() {
        View inflate = View.inflate(getActivity(), R.layout.newsviewpagerfragment, null);
        TabLayout mTabLayout = (TabLayout) inflate.findViewById(R.id.news_tbl);
        ViewPager mVpMain = (ViewPager) inflate.findViewById(R.id.news_viewpager);

        list.add(new Content1());
        list.add(new Content2());
        list.add(new Content3());
        list.add(new Content4());

        FragmentManager manager = getChildFragmentManager();
        mVpMain.setAdapter(new NewsAdapter(manager,list));

        mTabLayout.setupWithViewPager(mVpMain);

        return inflate;
    }

    @Override
    public void initData() {

    }

}
